<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org"
	  xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">


<div class="container-div">
	<div class="row">
		<div class="col-sm-12 animated fadeInRight">
			<div class="row" style="margin-left: 4.5rem;margin-top: 2rem;">
				<div class="col-sm-12">
					<div class="file-box" th:each="excelLog : ${excelLogs}">
						<div class="file">
							<a href="#"  th:onclick= "'javascript:phoneManager(\''+${excelLog.prefixExcelName}+'\')'" >
								<span class="corner"></span>
								<div class="image">
									<img alt="image" class="img-responsive" th:src="@{/img/excel.jpg}" src="../../static/img/excel.jpg">
								</div>
								<div class="file-name">
									<label th:text="${excelLog.excelName}" /><br/>
									<small >总条数：<a href="#"><label th:text="${excelLog.excelNum}" /></a></small><br/>
									<small >添加时间：<label th:text="${#dates.format(excelLog.importDate,'yyyy-MM-dd HH:mm')}" /></small>
									<button type="button" class="btn btn-sm btn-danger" th:onclick="'javascript:deleteData(\''+${excelLog.prefixExcelName}+'\',\''+${excelLog.id}+'\')'">删除数据</button>
								</div>
							</a>
						</div>
					</div>

				</div>
			</div>
		</div>
	</div>
</div>
<div th:include="include :: footer"></div>

<script th:inline="javascript">
    //调度日志查询
    function phoneManager(prefixExcelName) {
        var name =String(prefixExcelName);
        var url = ctx + 'phone/index?excelName='+name;
        createMenuItem(url, "手机号管理");
    }
	// 删除数据
    function deleteData(prefixExcelName,id){
        $.ajax({
            cache : true,
            type : "POST",
            url : ctx + "phone/deleteData",
            data : {
                "prefixExcelName": prefixExcelName,
                "id":id
            },
            async : false,
            error : function() {
                $.modal.alertError("系统错误");
            },
            success : function(data) {
                $.modal.alertSuccess("删除成功");
                setTimeout(function(){
                    //使用  setTimeout（）方法设定定时1200毫秒
                    location.reload(true);//页面刷新
                },1200);
            }
        });
	}

</script>


</body>
</html>